package com.atguigu.cms.controller;


import com.atguigu.cms.entity.CrmBanner;
import com.atguigu.cms.service.CrmBannerService;
import com.atguigu.commonutils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2023-03-30
 */
@RestController
@RequestMapping("/cms/crmbanner")
@CrossOrigin
public class FrontBannerController {

    @Autowired
    CrmBannerService bannerService;
    @GetMapping("/getAllBanner")
    public R getBanner()
    {

        List<CrmBanner> crmBanners = bannerService.selectAllBanner();
        return  R.ok().data("bannerList",crmBanners);

    }


}

